<template>
  <div>
    <div ref="myChart" style="height: 400px;" />
  </div>
</template>

<script>
// 1. 安装1并引入库
// 1. 安装1并引入库
// import * as echarts from 'echarts'
// 按需加载
import * as echarts from 'echarts/core'
import { RadarChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'
echarts.use([RadarChart, CanvasRenderer])
export default {
  mounted() {
    // 2. 实例化
    console.log(echarts)
    const chart = echarts.init(this.$refs.myChart)

    // 3. 开始画图
    const option = {
      textStyle: {
        fontSize: 14
      },
      color: ['#ff0000', '#00ff00'],
      radar: {
        // shape: 'circle',
        indicator: [
          { name: '销售', max: 6500 },
          { name: '管理', max: 16000 },
          { name: '技术', max: 30000 },
          { name: '售后', max: 38000 },
          { name: '开发', max: 52000 },
          { name: '营销', max: 25000 }
        ]
      },
      series: [
        {
          name: 'Budget vs spending',
          type: 'radar',
          data: [
            {
              value: [4200, 3000, 12000, 35000, 50000, 18000],
              name: 'Allocated Budget'
            },
            {
              value: [5000, 14000, 28000, 26000, 42000, 21000],
              name: 'Actual Spending'
            }
          ]
        }
      ]
    }

    chart.setOption(option)
  }
}
</script>

<style>

</style>
